<template>
	<view>
		<view class="top">
			<view class="cut" @click="site=true">
				{{year}}年
				<image src="../static/xia.png"></image>
			</view>
		</view>
		<view class="content">
			<view v-if="list.length>0" class="list_box">
				<view class="list" v-for="(item,index) in list" :key="index">
					<view class="left"></view>
					<view class="center">
						<view class="center_a">
							<view class="name">
								统计月份
							</view>
							<view class="text">
								{{item.month_number}}月
							</view>
						</view>
						<view class="center_a">
							<view class="name">
								当月总数
							</view>
							<view class="text">
								{{item.befor_all_number}}人
							</view>
						</view>
						<view class="center_a">
							<view class="name">
								当月新增
							</view>
							<view class="text">
								{{item.befor_month_number}}人
							</view>
						</view>
					</view>
					<view :class='[item.number<0 ? "right2" : "right1"]'>{{ item.number }}</view>
				</view>
			</view>
			<view class="none" v-else style="margin-top: 20rpx;">
				<view class="none-view">
					<image src="../../../static/image/none.png" class="none-image"></image>
					<view class="none-name">
						暂无相关数据~
					</view>
				</view>
			</view>
		</view>
		<u-picker v-model="site" mode="time" :params="params" :endYear="endYear" @confirm="confirm"></u-picker>
	</view>
</template>

<script>
	var than;
	export default {
		data() {
			return {
				list: [],
				page: 1,
				params: {
					year: true,
					month: false,
					day: false,
					hour: false,
					minute: false,
					second: false,
					province: false,
					city: false,
					area: false,
					timestamp: false,
				},
				site: false,
				year: "",
				uid: ""
			}
		},
		onLoad(option) {
			than = this;
			if (option.uid) {
				than.uid = option.uid;
			}
			than.year = than.endYear
			than.creditList();
		},
		methods: {
			confirm(e) {
				than.year = e.year
				than.creditList()
			},
			creditList() {
				than.post("api/teamhead/teamMonthList", {
					year: than.year,
					uid: than.uid
				}, function(data) {
					than.list = data;
				})
			}
		}
	}
</script>

<style lang="less">
	page {
		background: #F4F4F7;
	}

	.top {
		display: flex;
		align-items: center;
		height: 100rpx;

		.cut {
			margin-right: 36rpx;
			margin-left: auto;
			width: 180rpx;
			height: 64rpx;
			background: #FFFFFF;
			border-radius: 32rpx;
			display: flex;
			align-items: center;
			font-size: 24rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #666666;
			justify-content: center;

			image {
				margin-left: 15rpx;
				width: 24rpx;
				height: 14rpx;
			}
		}
	}


	.content {
		padding: 0rpx 36rpx;
		background-color: #F4F4F7;
		border-radius: 50rpx 50rpx 0 0;

		.con {
			height: 543rpx;
			width: 100%;
			background-color: white;
			border-radius: 20rpx;
			padding: 36rpx;
			margin-top: -100rpx;

			.head {
				font-size: 32rpx;
				color: #303030;
				text-align: center;
				font-weight: bold;
			}


			.tips {
				background: #FFEFE0;
				border-radius: 38px;
				padding: 20rpx;
				display: flex;
				align-items: center;
				margin: auto;
				margin-top: 30rpx;
				width: 440rpx;

				image {
					width: 55rpx;
					height: 34rpx;
				}

				.text {
					font-size: 26rpx;
					font-family: PingFang SC;
					font-weight: bold;
					color: #F46813;
				}
			}
		}

		.infor {
			background-color: white;
			border-radius: 20rpx;
			padding: 30rpx;
			display: flex;
			margin-top: 25rpx;

			.item {
				flex: 1;
				text-align: center;

				.item1 {
					font-size: 48rpx;
					font-weight: bold;
					color: #111111;
					font-style: italic;
					font-family: myFirstFont;
				}

				.item2 {
					font-size: 26rpx;
					font-weight: bold;
					color: #262626;
				}
			}

			.item:first-child {
				border-right: 2rpx solid #F1F1F1;
			}
		}

		.title {
			display: flex;
			margin-top: 30rpx;

			.item1 {
				flex: 1;
				font-size: 32rpx;
				font-weight: bold;
				color: #333333;
			}

			.item2 {
				text-align: right;
				font-size: 28rpx;
				font-weight: bold;
				color: #848484;
				display: flex;
				align-items: center;

				image {
					width: 28rpx;
					height: 28rpx;
					margin-left: 10rpx;
				}
			}
		}

		.list_box {
			padding-bottom: 60rpx;

			.list {
				background: white;
				border-radius: 20rpx;
				padding: 30rpx;
				margin-top: 20rpx;
				display: flex;
				align-items: center;

				.left {
					height: 20rpx;
					width: 20rpx;
					background: #03E380;
					border-radius: 50%;
				}

				.center {
					flex: 1;
					margin-left: 20rpx;

					.center_a {

						display: flex;
						align-items: center;

						.name {
							font-size: 30rpx;
							font-family: PingFang SC;
							font-weight: 500;
							color: #666666;
						}

						.text {
							margin-left: 18rpx;
							font-size: 30rpx;
							font-weight: bold;
							color: #333333;
						}
					}

				}

				.right1 {
					font-size: 40rpx;
					font-weight: bold;
					color: #F46813;
					font-style: italic;
					font-family: myFirstFont;

				}

				.right2 {
					font-size: 40rpx;
					font-weight: bold;
					color: #1B1B1D;
					font-style: italic;
					font-family: myFirstFont;
				}
			}
		}
	}
</style>
